package cn.iocoder.yudao.module.wms.dal.mysql.vehicle;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.wms.dal.dataobject.vehicle.VehicleDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.wms.controller.admin.vehicle.vo.*;

/**
 * 车辆资料 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface VehicleMapper extends BaseMapperX<VehicleDO> {

    default PageResult<VehicleDO> selectPage(VehiclePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<VehicleDO>()
                .eqIfPresent(VehicleDO::getCreateAt, reqVO.getCreateAt())
                .eqIfPresent(VehicleDO::getDriving, reqVO.getDriving())
                .eqIfPresent(VehicleDO::getNumber, reqVO.getNumber())
                .eqIfPresent(VehicleDO::getType, reqVO.getType())
                .orderByDesc(VehicleDO::getUpdateAt));
    }

}